import React from 'react'

interface PersonProps {
  name: string;
  content?: React.ReactNode  //jsx类型
}
function Person(props: PersonProps) {
  return (
    <div>
      <h3>你好,我是{props.name}</h3>
      {props.content}
    </div>
  )
}

const Animal: React.FunctionComponent<PersonProps> = (props) => {
  return (
    <div>
      <h2>动物:{props.name}</h2>
    </div>
  )
}

function App() {
  return (
    <div>
      <h2>Hello TS!</h2>
      <Person name={'lux'} content={<button>提交</button>} />

      <Animal name={'老虎'} />
    </div>
  )
}

export default App;
